<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>数据转换</title>
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/font-awesome.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/main.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/libs/elementUI-2.12/index.css">
    <script src="${request.contextPath}/statics/libs/jquery.min.js"></script>
    <script src="${request.contextPath}/statics/libs/bootstrap.min.js"></script>
    <script src="${request.contextPath}/statics/libs/vue/vue.js"></script>
    <script src="${request.contextPath}/statics/libs/vue/vue-resource.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="${request.contextPath}/statics/plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/ztree/jquery.ztree.all.min.js"></script>
    <script src="${request.contextPath}/statics/js/common.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/libs/elementUI-2.12/index.js"></script>
    <script src="${request.contextPath}/statics/plugins/layer/layer.js"></script>
    <style>
        .el-select {
            display: block;
        }

        .el-date-editor.el-input {
            width: 100%;
        }
    </style>
</head>
<body class="dark-bg">
<div id="exchangeData">
    <div style="padding: 20px">
        <el-form :model="searchData" label-width="120px" ref="searchData" size="small">
            <el-row>
                <el-col :span="8">
                    <el-form-item label="地市机构：" style="">
                        <el-input v-model.trim="searchData.area"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="法人机构：" style="">
                        <el-input v-model.trim="searchData.company"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="8">
                    <el-form-item label="模型类型：" style="">
                        <el-input v-model.trim="searchData.modelType"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="模型状态：" style="">
                        <el-input v-model.trim="searchData.modelState"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-form-item style="text-align: center" label-width="0px">
                    <el-button size="small" type="primary" icon="fa fa-search" @click="query(1,10)"> 查询</el-button>
                    <el-button size="small" type="danger" icon="fa fa-refresh" @click="resetSearchForm()"> 重置
                    </el-button>
                    <el-button size="small" type="success" icon="fa fa-plus-square" @click="newModel()"> 新增模型
                    </el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <div>
        <el-table :data="tableData"
                  border
                  style="width: 100%"
                  :header-cell-style="{'text-align':'center'}">
            <el-table-column
                    prop="corpId"
                    label="机构编码" align="center">
            </el-table-column>
            <el-table-column
                    prop="corpName"
                    label="机构名称" align="center">
            </el-table-column>
            <el-table-column
                    prop="modelType"
                    label="模型类型" align="center">
            </el-table-column>
            <el-table-column
                    prop="editionNo"
                    label="版本号" align="center">
            </el-table-column>
            <el-table-column
                    prop="createDate"
                    label="创建时间" align="center">
            </el-table-column>
            <el-table-column
                    prop="modifyDate"
                    label="修改时间" align="center">
            </el-table-column>
            <el-table-column
                    prop="effectDate"
                    label="生效时间" align="center">
            </el-table-column>
            <el-table-column
                    prop="state"
                    label="状态" width="80px" align="center">
            </el-table-column>
            <el-table-column label="操作" width="220px">
                <template slot-scope="scope">
                    <el-button
                            size="mini"
                            type="primary"
                            @click="handleEdit(scope.$index, scope.row)">查看
                    </el-button>
                    <el-button
                            size="mini"
                            type="success"
                            @click="handleDelete(scope.$index, scope.row)">升级
                    </el-button>
                    <el-button
                            size="mini"
                            type="warning"
                            @click="handleCopy(scope.$index, scope.row)">复制
                    </el-button>
                </template>
            </el-table-column>
        </el-table>
        <div class="block">
            <el-pagination
                    @size-change="pageSizeChange"
                    @current-change="pageCurrentChange"
                    :current-page.sync="page.currentPage"
                    :page-sizes="[10, 20, 50, 100]"
                    :page-size="page.pageSize"
                    layout="sizes, prev, pager, next"
                    :total="page.totalRows">
            </el-pagination>
        </div>
    </div>
    <el-dialog title="规则查看" :visible.sync="show.dialogRule" :close-on-click-modal="false" width="100%" top="4vh"
               center v-loading="loading" fullScreen>
        <el-form :model="ruleSearchData" label-width="120px" style="margin-top: 0px">
            <el-row>
                <el-col :span="12" style="margin-left: 20%">
                    <el-form-item label="规则名称：" style="">
                        <el-input v-model.trim="ruleSearchData.ruleName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12" style="margin-left: 20%">
                    <el-form-item label="适用对象：" style="">
                        <el-select v-model="ruleSearchData.suitOp" multiple placeholder="请选择">
                            <el-option
                                    v-for="item in options"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>

            <el-row>
                <el-form-item style="text-align: center" label-width="0px">
                    <el-button size="small" type="primary" icon="fa fa-search" @click="queryRules(1,10)"> 查询</el-button>
                    <el-button size="small" type="danger" icon="fa fa-refresh" @click="resetRuleSearch()"> 重置
                    </el-button>
                    <el-button size="small" type="danger" icon="fa fa-plus-square" @click="addNewRule()"> 新增</el-button>
                    <el-button size="small" type="success" icon="fa fa-backward" @click="comeBack()"> 返回</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <div>
            <el-table :data="rulesData"
                      border
                      style="width: 100%"
                      :header-cell-style="{'text-align':'center'}">
                <el-table-column
                        prop="opeOrder"
                        label="执行顺序" width="80px" align="center">
                </el-table-column>
                <el-table-column
                        prop="ruleName"
                        label="规则名称" width="120px" align="center">
                </el-table-column>
                <el-table-column
                        prop="suitObj"
                        label="适用对象" width="600px" align="center">
                </el-table-column>
                <el-table-column
                        prop="refusePeriod"
                        label="拒绝周期(天)" width="80px" align="center">
                </el-table-column>
                <el-table-column label="操作" width="200px">
                    <template slot-scope="scope">
                        <el-button
                                size="mini"
                                type="primary"
                                @click="ruleEdit(scope.$index, scope.row)">查看
                        </el-button>
                        <el-button
                                size="mini"
                                type="success"
                                @click="ruleUpdate(scope.$index, scope.row)">维护
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="block">
                <el-pagination
                        @size-change="pageSizeChange1"
                        @current-change="pageCurrentChange1"
                        :current-page.sync="page1.currentPage"
                        :page-sizes="[10, 20, 50, 100]"
                        :page-size="page1.pageSize"
                        layout="sizes, prev, pager, next"
                        :total="page1.totalRows">
                </el-pagination>
            </div>
        </div>
    </el-dialog>

    <el-dialog title="规则编辑" :visible.sync="show.dialogRuleEdit" :close-on-click-modal="false" width="100%" top="4vh"
               center v-loading="loading" fullScreen>
        <el-form :model="ruleEditData" label-width="120px" style="">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="规则名称：" style="">
                        <el-input v-model.trim="ruleEditData.ruleName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="规则描述：" style="">
                        <el-input v-model.trim="ruleEditData.ruleDesc"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="执行顺序：" style="">
                        <el-input v-model.trim="ruleEditData.ruleOrder"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="拒绝周期(天)：" style="">
                        <el-input v-model.trim="ruleEditData.refusePeriod"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="">
                    <el-form-item label="适用对象：" style="">
                        <el-select v-model="ruleEditData.suitOp" multiple placeholder="请选择">
                            <el-option
                                    v-for="item in options"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="拒绝提示信息：" style="">
                        <el-input v-model.trim="ruleEditData.refuseInfo"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="通过提示信息：" style="">
                        <el-input v-model.trim="ruleEditData.accessInfo"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="审查提示信息：" style="">
                        <el-input v-model.trim="ruleEditData.examineInfo"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="外部数据展示信息：" style="">
                        <el-input v-model.trim="ruleEditData.outerInfo"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <div>
            <el-table :data="rulesDetailData"
                      border
                      style="width: 100%">
                <el-table-column
                        prop="rules"
                        label="规则" width="800px" align="center">
                </el-table-column>
                <el-table-column
                        prop="result"
                        label="规则结果" width="100px" align="center">
                </el-table-column>
                <el-table-column label="操作" width="400px">
                    <template slot-scope="scope">
                        <el-button
                                size="mini"
                                type="primary"
                                @click="ruleEdit(scope.$index, scope.row)">添加规则
                        </el-button>
                        <el-button
                                size="mini"
                                type="success"
                                @click="ruleEdit(scope.$index, scope.row)">复制规则
                        </el-button>
                        <el-button
                                size="mini"
                                type="danger"
                                @click="ruleUpdate(scope.$index, scope.row)">删除规则
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="block">
                <el-pagination
                        @size-change="pageSizeChange2"
                        @current-change="pageCurrentChange2"
                        :current-page.sync="page1.currentPage"
                        :page-sizes="[10, 20, 50, 100]"
                        :page-size="page2.pageSize"
                        layout="sizes, prev, pager, next"
                        :total="page2.totalRows">
                </el-pagination>
            </div>
        </div>
    </el-dialog>
</div>
<script type="text/javascript" src="${request.contextPath}/statics/js/modules/exch/exchangeData.js"></script>
</body>

</html>